<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>lacewing.moo.packet</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="lacewing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://mp2.dk">Python Lacewing Library</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="lacewing-module.html">Package&nbsp;lacewing</a> ::
        <a href="lacewing.moo-module.html">Package&nbsp;moo</a> ::
        Module&nbsp;packet
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="lacewing.moo.packet-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="lacewing.moo.packet-module.html">Module lacewing.moo.packet</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (c) 2011 Mathias Kaerlev.</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-comment"># See LICENSE for details.</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">struct</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">struct</tt> <tt class="py-keyword">import</tt> <tt class="py-name">unpack_from</tt><tt class="py-op">,</tt> <tt class="py-name">pack</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package lacewing=lacewing-module.html"><a title="lacewing" class="py-name" href="#" onclick="return doclink('link-0', 'lacewing', 'link-0');">lacewing</a></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Package lacewing.moo=lacewing.moo-module.html"><a title="lacewing.moo" class="py-name" href="#" onclick="return doclink('link-1', 'moo', 'link-1');">moo</a></tt><tt class="py-op">.</tt><tt id="link-2" class="py-name" targets="Package lacewing.moo.packetloaders=lacewing.moo.packetloaders-module.html,Package lacewing.packetloaders=lacewing.packetloaders-module.html"><a title="lacewing.moo.packetloaders
lacewing.packetloaders" class="py-name" href="#" onclick="return doclink('link-2', 'packetloaders', 'link-2');">packetloaders</a></tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Module lacewing.moo.packetloaders.server=lacewing.moo.packetloaders.server-module.html,Module lacewing.moo.server=lacewing.moo.server-module.html,Module lacewing.packetloaders.server=lacewing.packetloaders.server-module.html,Module lacewing.server=lacewing.server-module.html"><a title="lacewing.moo.packetloaders.server
lacewing.moo.server
lacewing.packetloaders.server
lacewing.server" class="py-name" href="#" onclick="return doclink('link-3', 'server', 'link-3');">server</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-4" class="py-name"><a title="lacewing" class="py-name" href="#" onclick="return doclink('link-4', 'lacewing', 'link-0');">lacewing</a></tt><tt class="py-op">.</tt><tt id="link-5" class="py-name"><a title="lacewing.moo" class="py-name" href="#" onclick="return doclink('link-5', 'moo', 'link-1');">moo</a></tt><tt class="py-op">.</tt><tt id="link-6" class="py-name"><a title="lacewing.moo.packetloaders
lacewing.packetloaders" class="py-name" href="#" onclick="return doclink('link-6', 'packetloaders', 'link-2');">packetloaders</a></tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Module lacewing.client=lacewing.client-module.html,Module lacewing.moo.client=lacewing.moo.client-module.html,Module lacewing.moo.packetloaders.client=lacewing.moo.packetloaders.client-module.html,Module lacewing.packetloaders.client=lacewing.packetloaders.client-module.html"><a title="lacewing.client
lacewing.moo.client
lacewing.moo.packetloaders.client
lacewing.packetloaders.client" class="py-name" href="#" onclick="return doclink('link-7', 'client', 'link-7');">client</a></tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-8" class="py-name"><a title="lacewing" class="py-name" href="#" onclick="return doclink('link-8', 'lacewing', 'link-0');">lacewing</a></tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="lacewing.moo" class="py-name" href="#" onclick="return doclink('link-9', 'moo', 'link-1');">moo</a></tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="lacewing.moo.packetloaders
lacewing.packetloaders" class="py-name" href="#" onclick="return doclink('link-10', 'packetloaders', 'link-2');">packetloaders</a></tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Module lacewing.moo.packetloaders.common=lacewing.moo.packetloaders.common-module.html,Module lacewing.packetloaders.common=lacewing.packetloaders.common-module.html"><a title="lacewing.moo.packetloaders.common
lacewing.packetloaders.common" class="py-name" href="#" onclick="return doclink('link-11', 'common', 'link-11');">common</a></tt> <tt class="py-keyword">import</tt> <tt class="py-name">OutOfData</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt id="link-12" class="py-name" targets="Variable lacewing.moo.packet.csTypes=lacewing.moo.packet-module.html#csTypes"><a title="lacewing.moo.packet.csTypes" class="py-name" href="#" onclick="return doclink('link-12', 'csTypes', 'link-12');">csTypes</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line">    <tt class="py-number">1</tt> <tt class="py-op">:</tt> <tt id="link-13" class="py-name" targets="Class lacewing.moo.packetloaders.client.ToChannelMessage=lacewing.moo.packetloaders.client.ToChannelMessage-class.html"><a title="lacewing.moo.packetloaders.client.ToChannelMessage" class="py-name" href="#" onclick="return doclink('link-13', 'ToChannelMessage', 'link-13');">ToChannelMessage</a></tt><tt class="py-op">,</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line">    <tt class="py-number">2</tt> <tt class="py-op">:</tt> <tt id="link-14" class="py-name" targets="Class lacewing.moo.packetloaders.client.ClientMessage=lacewing.moo.packetloaders.client.ClientMessage-class.html"><a title="lacewing.moo.packetloaders.client.ClientMessage" class="py-name" href="#" onclick="return doclink('link-14', 'ClientMessage', 'link-14');">ClientMessage</a></tt><tt class="py-op">,</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line">    <tt class="py-number">3</tt> <tt class="py-op">:</tt> <tt id="link-15" class="py-name" targets="Class lacewing.moo.packetloaders.client.PrivateMessage=lacewing.moo.packetloaders.client.PrivateMessage-class.html"><a title="lacewing.moo.packetloaders.client.PrivateMessage" class="py-name" href="#" onclick="return doclink('link-15', 'PrivateMessage', 'link-15');">PrivateMessage</a></tt><tt class="py-op">,</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line">    <tt class="py-number">4</tt> <tt class="py-op">:</tt> <tt id="link-16" class="py-name" targets="Class lacewing.moo.packetloaders.client.JoinChannel=lacewing.moo.packetloaders.client.JoinChannel-class.html"><a title="lacewing.moo.packetloaders.client.JoinChannel" class="py-name" href="#" onclick="return doclink('link-16', 'JoinChannel', 'link-16');">JoinChannel</a></tt><tt class="py-op">,</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line">    <tt class="py-number">5</tt> <tt class="py-op">:</tt> <tt id="link-17" class="py-name" targets="Class lacewing.moo.packetloaders.client.LeaveChannel=lacewing.moo.packetloaders.client.LeaveChannel-class.html"><a title="lacewing.moo.packetloaders.client.LeaveChannel" class="py-name" href="#" onclick="return doclink('link-17', 'LeaveChannel', 'link-17');">LeaveChannel</a></tt><tt class="py-op">,</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line">    <tt class="py-number">11</tt> <tt class="py-op">:</tt> <tt id="link-18" class="py-name" targets="Class lacewing.moo.packetloaders.client.ChangeName=lacewing.moo.packetloaders.client.ChangeName-class.html"><a title="lacewing.moo.packetloaders.client.ChangeName" class="py-name" href="#" onclick="return doclink('link-18', 'ChangeName', 'link-18');">ChangeName</a></tt><tt class="py-op">,</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line">    <tt class="py-number">12</tt> <tt class="py-op">:</tt> <tt id="link-19" class="py-name" targets="Class lacewing.moo.packetloaders.client.SetName=lacewing.moo.packetloaders.client.SetName-class.html"><a title="lacewing.moo.packetloaders.client.SetName" class="py-name" href="#" onclick="return doclink('link-19', 'SetName', 'link-19');">SetName</a></tt><tt class="py-op">,</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line"> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"><tt class="py-op">}</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line"> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line"><tt id="link-20" class="py-name" targets="Variable lacewing.moo.packet.scTypes=lacewing.moo.packet-module.html#scTypes"><a title="lacewing.moo.packet.scTypes" class="py-name" href="#" onclick="return doclink('link-20', 'scTypes', 'link-20');">scTypes</a></tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line">    <tt class="py-number">1</tt> <tt class="py-op">:</tt> <tt id="link-21" class="py-name" targets="Class lacewing.moo.packetloaders.server.FromChannelMessage=lacewing.moo.packetloaders.server.FromChannelMessage-class.html"><a title="lacewing.moo.packetloaders.server.FromChannelMessage" class="py-name" href="#" onclick="return doclink('link-21', 'FromChannelMessage', 'link-21');">FromChannelMessage</a></tt><tt class="py-op">,</tt> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line">    <tt class="py-number">5</tt> <tt class="py-op">:</tt> <tt id="link-22" class="py-name" targets="Class lacewing.moo.packetloaders.server.PlayerLeft=lacewing.moo.packetloaders.server.PlayerLeft-class.html"><a title="lacewing.moo.packetloaders.server.PlayerLeft" class="py-name" href="#" onclick="return doclink('link-22', 'PlayerLeft', 'link-22');">PlayerLeft</a></tt><tt class="py-op">,</tt> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line">    <tt class="py-number">6</tt> <tt class="py-op">:</tt> <tt id="link-23" class="py-name" targets="Class lacewing.moo.packetloaders.server.PlayerJoined=lacewing.moo.packetloaders.server.PlayerJoined-class.html"><a title="lacewing.moo.packetloaders.server.PlayerJoined" class="py-name" href="#" onclick="return doclink('link-23', 'PlayerJoined', 'link-23');">PlayerJoined</a></tt><tt class="py-op">,</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line">    <tt class="py-number">7</tt> <tt class="py-op">:</tt> <tt id="link-24" class="py-name" targets="Class lacewing.moo.packetloaders.server.PlayerExists=lacewing.moo.packetloaders.server.PlayerExists-class.html"><a title="lacewing.moo.packetloaders.server.PlayerExists" class="py-name" href="#" onclick="return doclink('link-24', 'PlayerExists', 'link-24');">PlayerExists</a></tt><tt class="py-op">,</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line">    <tt class="py-number">8</tt> <tt class="py-op">:</tt> <tt id="link-25" class="py-name" targets="Class lacewing.moo.packetloaders.server.ChannelJoined=lacewing.moo.packetloaders.server.ChannelJoined-class.html"><a title="lacewing.moo.packetloaders.server.ChannelJoined" class="py-name" href="#" onclick="return doclink('link-25', 'ChannelJoined', 'link-25');">ChannelJoined</a></tt><tt class="py-op">,</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line">    <tt class="py-number">10</tt> <tt class="py-op">:</tt> <tt id="link-26" class="py-name" targets="Class lacewing.moo.packetloaders.server.MOTD=lacewing.moo.packetloaders.server.MOTD-class.html"><a title="lacewing.moo.packetloaders.server.MOTD" class="py-name" href="#" onclick="return doclink('link-26', 'MOTD', 'link-26');">MOTD</a></tt><tt class="py-op">,</tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line">    <tt class="py-number">11</tt> <tt class="py-op">:</tt> <tt id="link-27" class="py-name" targets="Class lacewing.moo.packetloaders.server.PlayerChanged=lacewing.moo.packetloaders.server.PlayerChanged-class.html"><a title="lacewing.moo.packetloaders.server.PlayerChanged" class="py-name" href="#" onclick="return doclink('link-27', 'PlayerChanged', 'link-27');">PlayerChanged</a></tt><tt class="py-op">,</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line">    <tt class="py-number">12</tt> <tt class="py-op">:</tt> <tt id="link-28" class="py-name" targets="Class lacewing.moo.packetloaders.server.AssignedID=lacewing.moo.packetloaders.server.AssignedID-class.html"><a title="lacewing.moo.packetloaders.server.AssignedID" class="py-name" href="#" onclick="return doclink('link-28', 'AssignedID', 'link-28');">AssignedID</a></tt><tt class="py-op">,</tt> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line"><tt class="py-op">}</tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line"> </tt>
<a name="_Packet"></a><div id="_Packet-def"><a name="L34"></a><tt class="py-lineno">34</tt> <a class="py-toggle" href="#" id="_Packet-toggle" onclick="return toggle('_Packet');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lacewing.moo.packet._Packet-class.html">_Packet</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_Packet-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="_Packet-expanded"><a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">    <tt class="py-name">loader</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line">     </tt>
<a name="_Packet.__init__"></a><div id="_Packet.__init__-def"><a name="L37"></a><tt class="py-lineno">37</tt> <a class="py-toggle" href="#" id="_Packet.__init__-toggle" onclick="return toggle('_Packet.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lacewing.moo.packet._Packet-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">settings</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_Packet.__init__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="_Packet.__init__-expanded"><a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt> <tt class="py-op">=</tt> <tt class="py-name">settings</tt> </tt>
</div><a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line">     </tt>
<a name="_Packet.load"></a><div id="_Packet.load-def"><a name="L40"></a><tt class="py-lineno">40</tt> <a class="py-toggle" href="#" id="_Packet.load-toggle" onclick="return toggle('_Packet.load');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lacewing.moo.packet._Packet-class.html#load">load</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_Packet.load-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="_Packet.load-expanded"><a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line">            <tt class="py-name">packetId</tt><tt class="py-op">,</tt> <tt class="py-op">=</tt> <tt class="py-name">unpack_from</tt><tt class="py-op">(</tt><tt class="py-string">'&lt;B'</tt><tt class="py-op">,</tt> <tt id="link-29" class="py-name" targets="Method lacewing.bytereader.ByteReader.data()=lacewing.bytereader.ByteReader-class.html#data"><a title="lacewing.bytereader.ByteReader.data" class="py-name" href="#" onclick="return doclink('link-29', 'data', 'link-29');">data</a></tt><tt class="py-op">)</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">error</tt><tt class="py-op">:</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">OutOfData</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line">        <tt class="py-name">loader</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-30" class="py-name" targets="Variable lacewing.moo.packet.ClientPacket._loaderDict=lacewing.moo.packet.ClientPacket-class.html#_loaderDict,Variable lacewing.moo.packet.ServerPacket._loaderDict=lacewing.moo.packet.ServerPacket-class.html#_loaderDict"><a title="lacewing.moo.packet.ClientPacket._loaderDict
lacewing.moo.packet.ServerPacket._loaderDict" class="py-name" href="#" onclick="return doclink('link-30', '_loaderDict', 'link-30');">_loaderDict</a></tt><tt class="py-op">[</tt><tt class="py-name">packetId</tt><tt class="py-op">]</tt><tt class="py-op">(</tt><tt class="py-op">**</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">settings</tt><tt class="py-op">)</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">loader</tt> <tt class="py-op">=</tt> <tt class="py-name">loader</tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">loader</tt><tt class="py-op">.</tt><tt class="py-name">load</tt><tt class="py-op">(</tt><tt id="link-31" class="py-name"><a title="lacewing.bytereader.ByteReader.data" class="py-name" href="#" onclick="return doclink('link-31', 'data', 'link-29');">data</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt> </tt>
</div><a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line"> </tt>
<a name="_Packet.generate"></a><div id="_Packet.generate-def"><a name="L49"></a><tt class="py-lineno">49</tt> <a class="py-toggle" href="#" id="_Packet.generate-toggle" onclick="return toggle('_Packet.generate');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="lacewing.moo.packet._Packet-class.html#generate">generate</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="_Packet.generate-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="_Packet.generate-expanded"><a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line">        <tt class="py-name">packetId</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">k</tt> <tt class="py-keyword">for</tt> <tt class="py-op">(</tt><tt class="py-name">k</tt><tt class="py-op">,</tt> <tt class="py-name">v</tt><tt class="py-op">)</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-32" class="py-name"><a title="lacewing.moo.packet.ClientPacket._loaderDict
lacewing.moo.packet.ServerPacket._loaderDict" class="py-name" href="#" onclick="return doclink('link-32', '_loaderDict', 'link-30');">_loaderDict</a></tt><tt class="py-op">.</tt><tt id="link-33" class="py-name" targets="Method lacewing.bitdict.BitDict.iteritems()=lacewing.bitdict.BitDict-class.html#iteritems"><a title="lacewing.bitdict.BitDict.iteritems" class="py-name" href="#" onclick="return doclink('link-33', 'iteritems', 'link-33');">iteritems</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt>  </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">loader</tt><tt class="py-op">,</tt> <tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">pack</tt><tt class="py-op">(</tt><tt class="py-string">'&lt;B'</tt><tt class="py-op">,</tt> <tt class="py-name">packetId</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">loader</tt><tt class="py-op">.</tt><tt id="link-34" class="py-name" targets="Method lacewing.moo.packetloaders.client.ChangeName.generate()=lacewing.moo.packetloaders.client.ChangeName-class.html#generate,Method lacewing.moo.packetloaders.client.ClientMessage.generate()=lacewing.moo.packetloaders.client.ClientMessage-class.html#generate,Method lacewing.moo.packetloaders.client.JoinChannel.generate()=lacewing.moo.packetloaders.client.JoinChannel-class.html#generate,Method lacewing.moo.packetloaders.client.LeaveChannel.generate()=lacewing.moo.packetloaders.client.LeaveChannel-class.html#generate,Method lacewing.moo.packetloaders.client.PrivateMessage.generate()=lacewing.moo.packetloaders.client.PrivateMessage-class.html#generate,Method lacewing.moo.packetloaders.client.SetName.generate()=lacewing.moo.packetloaders.client.SetName-class.html#generate,Method lacewing.moo.packetloaders.client.ToChannelMessage.generate()=lacewing.moo.packetloaders.client.ToChannelMessage-class.html#generate,Method lacewing.moo.packetloaders.message.Message.generate()=lacewing.moo.packetloaders.message.Message-class.html#generate,Method lacewing.moo.packetloaders.server.AssignedID.generate()=lacewing.moo.packetloaders.server.AssignedID-class.html#generate,Method lacewing.moo.packetloaders.server.ChannelJoined.generate()=lacewing.moo.packetloaders.server.ChannelJoined-class.html#generate,Method lacewing.moo.packetloaders.server.FromChannelMessage.generate()=lacewing.moo.packetloaders.server.FromChannelMessage-class.html#generate,Method lacewing.moo.packetloaders.server.MOTD.generate()=lacewing.moo.packetloaders.server.MOTD-class.html#generate,Method lacewing.moo.packetloaders.server.PlayerChanged.generate()=lacewing.moo.packetloaders.server.PlayerChanged-class.html#generate,Method lacewing.moo.packetloaders.server.PlayerLeft.generate()=lacewing.moo.packetloaders.server.PlayerLeft-class.html#generate,Method lacewing.packetloaders.client.ChannelMaster.generate()=lacewing.packetloaders.client.ChannelMaster-class.html#generate,Method lacewing.packetloaders.client.Request.generate()=lacewing.packetloaders.client.Request-class.html#generate,Method lacewing.packetloaders.server.ChannelPeer.generate()=lacewing.packetloaders.server.ChannelPeer-class.html#generate,Method lacewing.packetloaders.server.Peer.generate()=lacewing.packetloaders.server.Peer-class.html#generate,Method lacewing.packetloaders.server.Response.generate()=lacewing.packetloaders.server.Response-class.html#generate"><a title="lacewing.moo.packetloaders.client.ChangeName.generate
lacewing.moo.packetloaders.client.ClientMessage.generate
lacewing.moo.packetloaders.client.JoinChannel.generate
lacewing.moo.packetloaders.client.LeaveChannel.generate
lacewing.moo.packetloaders.client.PrivateMessage.generate
lacewing.moo.packetloaders.client.SetName.generate
lacewing.moo.packetloaders.client.ToChannelMessage.generate
lacewing.moo.packetloaders.message.Message.generate
lacewing.moo.packetloaders.server.AssignedID.generate
lacewing.moo.packetloaders.server.ChannelJoined.generate
lacewing.moo.packetloaders.server.FromChannelMessage.generate
lacewing.moo.packetloaders.server.MOTD.generate
lacewing.moo.packetloaders.server.PlayerChanged.generate
lacewing.moo.packetloaders.server.PlayerLeft.generate
lacewing.packetloaders.client.ChannelMaster.generate
lacewing.packetloaders.client.Request.generate
lacewing.packetloaders.server.ChannelPeer.generate
lacewing.packetloaders.server.Peer.generate
lacewing.packetloaders.server.Response.generate" class="py-name" href="#" onclick="return doclink('link-34', 'generate', 'link-34');">generate</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line"> </tt>
<a name="ServerPacket"></a><div id="ServerPacket-def"><a name="L54"></a><tt class="py-lineno">54</tt> <a class="py-toggle" href="#" id="ServerPacket-toggle" onclick="return toggle('ServerPacket');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lacewing.moo.packet.ServerPacket-class.html">ServerPacket</a><tt class="py-op">(</tt><tt class="py-base-class">_Packet</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ServerPacket-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="ServerPacket-expanded"><a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line">    <tt id="link-35" class="py-name"><a title="lacewing.moo.packet.ClientPacket._loaderDict
lacewing.moo.packet.ServerPacket._loaderDict" class="py-name" href="#" onclick="return doclink('link-35', '_loaderDict', 'link-30');">_loaderDict</a></tt> <tt class="py-op">=</tt> <tt id="link-36" class="py-name"><a title="lacewing.moo.packet.scTypes" class="py-name" href="#" onclick="return doclink('link-36', 'scTypes', 'link-20');">scTypes</a></tt> </tt>
</div><a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line"> </tt>
<a name="ClientPacket"></a><div id="ClientPacket-def"><a name="L57"></a><tt class="py-lineno">57</tt> <a class="py-toggle" href="#" id="ClientPacket-toggle" onclick="return toggle('ClientPacket');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="lacewing.moo.packet.ClientPacket-class.html">ClientPacket</a><tt class="py-op">(</tt><tt class="py-base-class">_Packet</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ClientPacket-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="ClientPacket-expanded"><a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line">    <tt id="link-37" class="py-name"><a title="lacewing.moo.packet.ClientPacket._loaderDict
lacewing.moo.packet.ServerPacket._loaderDict" class="py-name" href="#" onclick="return doclink('link-37', '_loaderDict', 'link-30');">_loaderDict</a></tt> <tt class="py-op">=</tt> <tt id="link-38" class="py-name"><a title="lacewing.moo.packet.csTypes" class="py-name" href="#" onclick="return doclink('link-38', 'csTypes', 'link-12');">csTypes</a></tt> </tt>
</div><a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="lacewing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://mp2.dk">Python Lacewing Library</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Dec 22 06:20:01 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
